
import amPie
import Chart

class amColumn(amPie.amPie):
    def blankChart(self):
        return Chart.ColumnChart()
    def envPrefix(self):
        return "amchart." # xxxx??
    def getswfFile(self, env):
        return self.absolutePath("amcolumn/amcolumn.swf", env)
    def getpath(self, env):
        return self.absolutePath("amcolumn/", env)
    def getswfObjectJs(self, env):
        return self.absolutePath("amcolumn/swfobject.js", env)
    def getChart(self, env, start_response):
        C = self.blankChart()
        D = {}
        self.addParamFromArgOrEnv(D, "labels", env, {}, asJson=True)
        self.addParamFromArgOrEnv(D, "settings", env, {}, asJson=True)
        self.addParamFromArgOrEnv(D, "graphs", env, [], asJson=True)
        self.addParamFromArgOrEnv(D, "series", env, [], asJson=True)
        self.addParamFromArgOrEnv(D, "guides", env, [], asJson=True)
        C.fromDict(D, env)
        C.rectify()
        return C

__middleware__ = amColumn

